// editableList.module.scss

.listContainer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 460px;
  // margin: 20px auto;
  position: relative;
  padding-left: 16px;
}

.item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  position: relative;
  transition: background-color 0.2s ease;

  &::before {
    // 小圆点本身
    content: "";
    position: absolute;
    left: -13px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #353535;
    z-index: 1;


    :global(.dark) & {
      background-color: #BDBDBD;
    }
  }

  &::after {
    // 小圆点下连线
    content: "";
    position: absolute;
    left: -10px;
    top: 50%;
    bottom: -50%;
    width: 1px;
    background-color: #E5E5E5;
    z-index: 0;

    :global(.dark) & {
      background-color: #353535;
    }
  }

  // 关键：拖动时隐藏下连线（黑点保留）
  &.dragging::after {
    display: none;
  }

  &:last-child::after {
    content: none; // 最后一项不显示下连线
  }

  &:hover {
    .deleteButton {
      display: flex;
    }
  }



}

.tag {
  color: #353535;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  user-select: none;
  width: 32px;
  height: 32px;
  background: #E9E9E9;
  border-radius: 8px;

  :global(.dark) & {
    background: #DEDEDE;
  }
}

.labelAndDelBtn {
  flex: 1;
  display: flex;
  line-height: 32px;
  height: 32px;
  border-radius: 8px;
  color: #353535;

  min-width: 0; // ✅ 必加，允许 .label 触发省略

  &:hover {
    background-color: #F3F3F3;
  }

  :global(.dark) & {
    &:hover {
      background: #2E3033;
    }

    color:#BDBDBD;
  }
}

.label {
  flex: 1;
  font-size: 14px;
  padding-left: 8px;
  cursor: pointer;
  outline: none;

  // ✅ 文本省略配置
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

}

.input {
  flex: 1;
  // padding: 4px 8px;
  height: 32px;
  padding-left: 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 8px;

  :global(.dark) & {
    border: 1px solid #3F4245;
    background: none;
    color: #DEDEDE;

    &:focus {
      border-color: #3F4245;
    }
  }
}

.deleteButton {
  margin-right: 16px;
  display: none;
  border: none;
  background: none;
  cursor: pointer;
  // color: #c00;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;

  // &:hover {
  //   background-color: #ffefef;
  // }
}

.addBtn {
  font-weight: 500;
  font-size: 16px;
  color: #151515;
  background: #FFFFFF;
  border-radius: 8px;
  border: 1px solid #DEDEDE;
  margin-top: 27px;
  display: flex;
  align-items: center;
  width: 174px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-style: normal;

  span {
    color: #353535;
    margin-right: 5px;
    vertical-align: middle;
    font-size: 18px;
  }
}

.addBtn:hover {
  background: #F3F3F3;
  border: 1px solid #E3E3E3;
}